<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditAccountTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditAccountLabel_id}" for="id" />
                    <h:inputText id="id" value="#{accountController.selected.id}" title="#{bundle.EditAccountTitle_id}" required="true" requiredMessage="#{bundle.EditAccountRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditAccountLabel_userName}" for="userName" />
                    <h:inputText id="userName" value="#{accountController.selected.userName}" title="#{bundle.EditAccountTitle_userName}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_password}" for="password" />
                    <h:inputText id="password" value="#{accountController.selected.password}" title="#{bundle.EditAccountTitle_password}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_fullName}" for="fullName" />
                    <h:inputText id="fullName" value="#{accountController.selected.fullName}" title="#{bundle.EditAccountTitle_fullName}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_dayofBirth}" for="dayofBirth" />
                    <h:inputText id="dayofBirth" value="#{accountController.selected.dayofBirth}" title="#{bundle.EditAccountTitle_dayofBirth}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditAccountLabel_gender}" for="gender" />
                    <h:inputText id="gender" value="#{accountController.selected.gender}" title="#{bundle.EditAccountTitle_gender}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_email}" for="email" />
                    <h:inputText id="email" value="#{accountController.selected.email}" title="#{bundle.EditAccountTitle_email}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_phone}" for="phone" />
                    <h:inputText id="phone" value="#{accountController.selected.phone}" title="#{bundle.EditAccountTitle_phone}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_address}" for="address" />
                    <h:inputText id="address" value="#{accountController.selected.address}" title="#{bundle.EditAccountTitle_address}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_cardNumber}" for="cardNumber" />
                    <h:inputText id="cardNumber" value="#{accountController.selected.cardNumber}" title="#{bundle.EditAccountTitle_cardNumber}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_status}" for="status" />
                    <h:inputText id="status" value="#{accountController.selected.status}" title="#{bundle.EditAccountTitle_status}" />
                    <h:outputLabel value="#{bundle.EditAccountLabel_role}" for="role" />
                    <h:selectOneMenu id="role" value="#{accountController.selected.role}" title="#{bundle.EditAccountTitle_role}" >
                        <f:selectItems value="#{roleController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{accountController.update}" value="#{bundle.EditAccountSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditAccountViewLink}"/>
                <br />
                <h:commandLink action="#{accountController.prepareList}" value="#{bundle.EditAccountShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditAccountIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
